#include "widget.h"
#include "ui_widget.h"
#include <fstream>
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
    std::ifstream file("C:/Users/25645/Desktop/tmp.txt");
    if(!file.is_open())
    {
        qDebug()<<"打开文件失败";
        return;
    }

    std::string line;
    while(std::getline(file,line))
    {
        //将取到的参数传到下拉菜单
        ui->comboBox->addItem(QString::fromStdString(line));
    }
    file.close();
}

Widget::~Widget()
{
    delete ui;
}

